update value of a key from a dictionary